﻿<?php

$obj=new mysql($config);

if(!empty($_POST)){
$arr=array();
$id=$_POST['id'];
$arr['attr_value']=!empty($_POST['attr_value'])?str_replace('，',',',$_POST['attr_value']):'';
$arr['attr_type']=$_POST['attr_type'];
$arr['attr_name']=$_POST['attr_name'];
$row=$obj->update($arr,array('id'=>$id),'attr');
    if($row>-1){
        echo '<script>alert("更新成功");location.href="index.php?c=attr&a=list&mod=admin";</script>';
    }else{
        echo '<script>alert("更新失败");history.go(-1);</script>';
    }
}




$id=$_GET['id'];
$sql="select * from `attr` where id=$id";
$date=$obj->getOne($sql);





require_once (VIEW_PATH.'admin/layout.html');

